#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int DayOfMonth(int _year, int _month)
{
    int months[] = { 0,31,28,31,30,31,30,31,31,30,31,30,31 };
    int _day = 0;
    if (_month != 2)
    {
        _day = months[_month];
    }
    else
    {
        if ((_year % 4 == 0 && _year % 100 != 0) || (_year % 400 == 0))
        {
            months[_month] = 29;
            _day = months[_month];
        }
        else
        {
            _day = months[_month];
        }
    }

    return _day;
}

int main()
{
    int year = 0;
    int month = 0;
    scanf("%d %d", &year, &month);
    int day = DayOfMonth(year, month);
    printf("%d-%d-%d", year, month, day);

    return 0;
}